package com.yuexun.dhdoctor.module.meetingNew.model.impl;

import com.yuexun.dhdoctor.base.BaseEntity;
import com.yuexun.dhdoctor.module.meetingNew.api.MeetingNewApi;
import com.yuexun.dhdoctor.module.meetingNew.bean.MeetingNewCheckStateBean;
import com.yuexun.dhdoctor.module.meetingNew.bean.MeetingNewDetailBean;
import com.yuexun.dhdoctor.module.meetingNew.model.IMeetingNewDetailModel;
import com.yuexun.dhdoctor.util.ApiUtil;

import java.util.Map;

import rx.Observable;

/**
 * Created by work-jx on 2016/11/15.
 */
public class MeetingNewDetailModel implements IMeetingNewDetailModel {
    private MeetingNewApi api;

    public MeetingNewApi ApiInstance() {
        if (api != null) {
            return api;
        } else {
            return ApiUtil.getInstance().createRetrofitApi(MeetingNewApi.class);
        }
    }

    @Override
    public Observable<BaseEntity<MeetingNewDetailBean>> getMeetingDetail(Map<String, String> praise) {
        api = ApiInstance();
        return api.getMeetingDetail(praise);
    }

    @Override
    public Observable<BaseEntity<MeetingNewCheckStateBean>> getMeetingCheckState(Map<String, String> praise) {
        api = ApiInstance();
        return api.getMeetingCheckState(praise);
    }

    @Override
    public Observable<BaseEntity<String>> getMeetingCheck(Map<String, String> praise) {
        api = ApiInstance();
        return api.getMeetingCheck(praise);
    }

}
